package com.veo.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

//注入IOC容器
//处理指定的异常
@ControllerAdvice
public class GlobalExceptionHandler {

    //处理参数算术异常和空指针异常
    @ExceptionHandler({ArithmeticException.class,NullPointerException.class})
    public String handleException(){
        //跳转到指定的页面
        return "login";
    }

}
